<%
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", -1); //prevents caching at the proxy server
%>
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.text.*"%>
<%@ include file="Connections/conDB.jsp" %>
<%
Driver DriverRs = (Driver)Class.forName(MM_conDB_DRIVER).newInstance();
Connection ConnRs = DriverManager.getConnection(MM_conDB_STRING,MM_conDB_USERNAME,MM_conDB_PASSWORD);
String query = "SELECT * FROM tipo_grano ORDER BY tipo_grano ASC, color ASC";
PreparedStatement StatementRs = ConnRs.prepareStatement(query);
ResultSet Rsquery = StatementRs.executeQuery();
boolean Rsquery_hasData = Rsquery.next();
Object Rsquery_data;

%>
<html>
<head>
<title>CIMA v2 - Nuevo Cupo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="miestilo.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript" SRC="js/AnchorPosition.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="js/PopupWindow.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="js/date.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="js/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
	var cal1 = new CalendarPopup();
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<br>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" class="titulos" height="22">Nuevo Cupo</td>
    </tr>
  </table>
  <br>
<form name="form1">
    <table width="300" border="0" cellspacing="0" cellpadding="0">
      <tr> 
        <td align="right" class="etiqueta" width="112">No. de Certificado</td>
        <td width="15">&nbsp;</td>
        <td> 
          <input type="text" name="textfield" class="textfields" maxlength="50" size="19"></td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Fecha de Expedici&oacute;n</td>
        <td></td>
        <td> 
          <input type="text" name="textfield2" class="textfields" size="19" maxlength="50" onClick="blur()">
          <img src="images/calendar.jpg" class="cursor" name="Button1" onClick="cal1.select(document.form1.textfield2,'Button1','dd/MM/yyyy'); return false;"></td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Vol&uacute;men</td>
        <td>&nbsp;</td>
        <td> 
          <input type="text" name="textfield3" class="textfields" maxlength="50" size="19">
        </td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Unidad M&eacute;trica</td>
        <td>&nbsp;</td>
        <td>
          <input type="hidden" name="textfield4" class="textfields" maxlength="50" size="19" value="Tonelada" onClick="blur()">
		  Tonelada
        </td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Fecha de Inicio</td>
        <td>&nbsp;</td>
        <td> 
          <input type="text" name="textfield5" class="textfields" maxlength="50" size="19" onClick="blur()">
          <img src="images/calendar.jpg" width="24" height="21" class="cursor" name="Button2" onClick="cal1.select(document.form1.textfield5,'Button2','dd/MM/yyyy'); return false;"> 
        </td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Fecha de Vencimiento</td>
        <td>&nbsp;</td>
        <td> 
          <input type="text" name="textfield6" class="textfields" maxlength="50" size="19" onClick="blur()">
		  <img src="images/calendar.jpg" width="24" height="21" class="cursor" name="Button3" onClick="cal1.select(document.form1.textfield6,'Button3','dd/MM/yyyy'); return false;">
        </td>
      </tr>
      <tr> 
        <td align="right" class="etiqueta">Tipo de Grano</td>
        <td>&nbsp;</td>
        <td>
          <select name="select" size="1" class="textfields">
            <option value="ninguno">- - Tipo - -</option>
			<% while (Rsquery_hasData) { %>
				<option value="<%=Rsquery.getObject("id")%>"><%=Rsquery.getObject("tipo_grano")+" "+Rsquery.getObject("color")%></option>
			<% Rsquery_hasData = Rsquery.next();
			  }
			%>
          </select>
        </td>
      </tr>

      <tr> 
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td colspan="3" align="center"> 
          <input type="submit" name="Submit" value="Guardar" class="boton" onClick="window.close()">
          &nbsp;
          <input type="button" name="Submit2" value="Cerrar" class="boton" onClick="window.close()">
        </td>
      </tr>
    </table>
  </form>
</center>
</body>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</html>
<%
Rsquery.close();
StatementRs.close();
ConnRs.close();
%>